package com.opentae.data.mall.interfaces;

import com.opentae.core.mybatis.config.MyBatisRepository;
import com.opentae.core.mybatis.mapper.Mapper;
import com.opentae.data.mall.pojo.MyInviteDto;
import com.opentae.data.mall.beans.UserInviteInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Scope;

import java.util.List;

/**
 * 
 * Created by exampleCreater.
 */
@MyBatisRepository("tae_mall_userInviteInfoMapper")
@Scope("singleton")
@Lazy(true)
public interface UserInviteInfoMapper extends Mapper<UserInviteInfo> {
    //查询用户vip 等级
    Integer userLevel(@Param("mallUserId") Long mallUserId);
    //查询用户邀请的某个vip等级的数量
    int countInviteUser(@Param("agentId")Long agentId,@Param("lv")Integer lv);
    //增加推销的数量
    int changeShareNum(@Param("mallUserId")Long mallUserId,@Param("num")Integer num);
    //推荐人增加
    int changeInviteNum(@Param("mallUserId")Long mallUserId,@Param("num")Integer num);
    //加用户相应业绩
    void changeAchivement(@Param("mallUserId")Long mallUserId,@Param("level")Integer level,@Param("money")Double money);
    //查询邀请人id
    Long getAgent(@Param("mallUserId")Long mallUserId);

    //查询我推荐的人
    List<MyInviteDto> myInvite(@Param("startIndex")Integer startIndex,@Param("offset")Integer offset,
                               @Param("agentId")Long agentId,@Param("type")Integer type);
    int countMyInvite( @Param("agentId")Long agentId,@Param("type")Integer type);

    List<Long> getUpgradeUser(@Param("inviteVip")Integer inviteVip,@Param("reward")Double reward,
                              @Param("vipLevel") Integer vipLevel);
}
